import { KuiDialogProps } from './type';
import { PropType, inject, CSSProperties } from 'vue';
import { configProviderInjectionKey } from '../kui-config-provider/type';

export default {
	/**
	 * @zh 页面模式
	 */
	mode: {
		type: String as PropType<KuiDialogProps['mode']>,
		default: () => inject(configProviderInjectionKey, undefined)?.mode ?? 'light'
	},
	/**
	 * @zh 标题
	 */
	title: {
		type: String,
		default: ''
	},
	/**
	 * @zh 标题对齐方式
	 */
	titleAlign: {
		type: String as PropType<KuiDialogProps['titleAlign']>,
		default: 'center' as KuiDialogProps['titleAlign']
	},
	/**
	 * @zh 是否显示
	 */
	show: {
		type: Boolean,
		default: false
	},
	/**
	 * @zh 内容
	 */
	content: {
		type: String,
		default: ''
	},
	/**
	 * @zh 内容水平对齐方式
	 */
	contentAlign: {
		type: String as PropType<KuiDialogProps['contentAlign']>,
		default: 'center' as KuiDialogProps['contentAlign']
	},
	/**
	 * @zh 是否显示确定按钮
	 */
	confirmButton: {
		type: Boolean,
		default: true
	},
	/**
	 * @zh 是否显示取消按钮
	 */
	cancelButton: {
		type: Boolean,
		default: true
	},
	/**
	 * @zh 确定按钮文案
	 */
	confirmButtonText: {
		type: String,
		default: '确定'
	},
	/**
	 * @zh 取消按钮文案
	 */
	cancelButtonText: {
		type: String,
		default: '取消'
	},
	/**
	 * @zh 取消按钮是否自动关闭对话框
	 */
	cancelAutoClose: {
		type: Boolean,
		default: true
	},
	/**
	 * @zh 是否禁止滚动穿透，禁止时滚动弹出层不会引起页面滚动
	 */
	lockScroll: {
		type: Boolean,
		default: true
	},
	/**
	 * @zh 点击遮罩是否关闭对话框
	 */
	closeOnClickOverlay: {
		type: Boolean,
		default: false
	},
	/**
	 * @zh 底部按钮组排列方式
	 */
	footerDirection: {
		type: String as PropType<KuiDialogProps['footerDirection']>,
		default: 'row' as KuiDialogProps['footerDirection']
	},
	/**
	 * @zh 对话框类名
	 */
	dialogClass: {
		type: String,
		default: ''
	},
	/**
	 * @zh 对话框样式
	 */
	dialogStyle: {
		type: Object,
		default: {}
	},
	/**
	 * @zh 对话框圆角大小
	 */
	dialogRadius: {
		type: String as PropType<KuiDialogProps['dialogRadius']>,
		default: 'base' as KuiDialogProps['dialogRadius']
	},
	/**
	 * @zh 对话框类型
	 */
	type: {
		type: String as PropType<KuiDialogProps['type']>,
		default: 'normal' as KuiDialogProps['type']
	},
	/**
	 * @zh 按钮组类型
	 */
	footerType: {
		type: String as PropType<KuiDialogProps['footerType']>,
		default: 'margin' as KuiDialogProps['footerType']
	},
	/**
	 * @zh 编辑对话框输入框占位文本
	 */
	placeholderText: {
		type: String,
		default: '请输入内容'
	}
}